# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Adrian Sausenthaler <aur@sausenthaler.de>

pkgname=openpgl
pkgver=0.5.0
pkgrel=5
pkgdesc="Intel Open Path Guiding Library"
arch=('loong64' 'x86_64')
url="https://github.com/openpathguidinglibrary/openpgl"
license=('Apache')
depends=('onetbb')
makedepends=('cmake' 'make' 'gcc' 'ninja')
source=("$pkgname-$pkgver.tar.gz::https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('9b992ffa17ad6f9fcde48add5d9cc1e58be2daacd40478fb1babe0741a6c7a64f12f36c9c1f7d5ec6f79cdd847c082d39e03e58cfd9af1a903adca56f1ac19e1')

build() {
  cd openpgl-$pkgver
  cmake \
    -Bbuild \
    -GNinja \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DOPENPGL_BUILD_STATIC=OFF \
	-DCMAKE_BUILD_TYPE=Release

  ninja -C build
}

package() {
  cd openpgl-$pkgver
  DESTDIR="$pkgdir" ninja -C build install
}
